package com.swotxu.mall.coupon.controller;

import com.swotxu.common.utils.R;
import com.swotxu.mall.coupon.entity.CouponEntity;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

/**
 * 测试模拟会员服务调用优惠券服务
 *
 * @Date: 2020/12/14 23:16
 * @Author: swotXu
 */
@RefreshScope
@RestController
@RequestMapping("test/coupon")
public class TestCouponFeignController {

    @Value("${coupon.user.name}")
    private String name;
    @Value("${coupon.user.age}")
    private Integer age;

    @RequestMapping("/member/list")
    public R memberlist(){
        CouponEntity couponEntity = new CouponEntity();
        couponEntity.setCouponName("满100减10");
        return R.ok().put("coupons", Arrays.asList(couponEntity))
                .put("name", name).put("age", age);
    }
}
